var express = require('express');
var router = new express.Router();
var Mock = require('mockjs')


router.get('/list', function (req, res) {
  var merchants = Mock.mock({
    'list|4': [{
      name:'@cname',
      'phone':/\d{5,10}/,
      address:'@county(true)',
      'type|1':[{
        name: '菜鸟乡村',
        count:3
      },{
        name:'社区驿站'
      },{
        name:'校园驿站'
      }
      ],
    }]
  })


  res.send(merchants.list);

})

var merchants=[];

router.get('/add',function (request,response) {
  console.log(request.query);
  merchants.unshift(request.query)
  response.send({
    emps:merchants,
    flag:true
  })
})


module.exports= router;
